﻿<%@ Page Language="C#" MasterPageFile="../../MasterPage.Master" AutoEventWireup="true" CodeBehind="ICM_Cal_Price_Account.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Form.ICM_Cal_Price_Account" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="server">
       <script type="text/javascript">
            function openStatusEdit(icm_cal_price_account_seq)
            {
                   radopen("../Edit_Form/ICM_Cal_Price_Account.aspx?icm_cal_price_account_seq="+icm_cal_price_account_seq+"&status="+"Edit","WindowDetail" );
            }
            function openStautsAdd()
            {
                   radopen("../Edit_Form/ICM_Cal_Price_Account.aspx"+ "?icm_cal_price_account_seq="+""+"&status="+"Add" ,"WindowDetail");
            }
            function closeRadWindow(sender, args) {
                   $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest('Receive');
            }
</script>  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdPriceAccount" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="btnInsert" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="grdPriceAccount">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdPriceAccount" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>    
</telerik:RadAjaxManager>
<div class="moduleContent1000">
           <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel2" runat="server" CssClass="contentPaneDiv" Height="30px" ScrollBars="Auto" >
                            <table cellpadding="0" cellspacing="0">
                                <tr class="command-list">
                                    <td>
                                        <asp:LinkButton ID="btnInsert" runat="server" CausesValidation="false" CssClass="LinkButton" OnClick="btnInsert_Click">
                                        <img alt="" src="../Image/Grid/AddRecord.gif" style="border:0px;vertical-align:middle;" />&#160;&#160;เพิ่มข้อมูลใหม่ </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                  </asp:Panel>
            </div>
</div>
<div class="moduleContent1000">
              <div class="moduleDivBottom1000">
                 <asp:Panel ID="Panel1" runat="server" CssClass="contentPaneDiv" Height="400px" ScrollBars="Auto" align = "center" >    
                           <div class="header-grid" align="left">
                                <asp:Label ID="Label4" runat="server" Text="ราคาพัสดุทางบัญชี"></asp:Label>
                           </div>
                           <table>
                                  <tr>
                                        <td>
                                            <telerik:RadGrid ID="grdPriceAccount" runat="server" AutoGenerateColumns="false"
                                                                AllowMultiRowEdit="false" AllowMultiRowSelection="true" ShowStatusBar="true"
                                                                Width="900px" Height="288px" AllowPaging="true" AllowFilteringByColumn="true"
                                                                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                                GroupingSettings-GroupContinuedFormatString=""
                                                                GroupingSettings-GroupContinuesFormatString=""
                                                                GroupingSettings-GroupSplitFormat="" PageSize ="7" 
                                                                OnNeedDataSource="grdPriceAccount_NeedDataSource" 
                                                                OnItemCommand="grdPriceAccount_ItemCommand" align ="left">
                                                                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                                                                ShowGroupFooter="true" 
                                                                DataKeyNames="icm_cal_price_account_seq" NoMasterRecordsText="< ไม่มีข้อมูล >" GroupsDefaultExpanded="true">
                                            <RowIndicatorColumn>
                                                <HeaderStyle Width="20px" />
                                            </RowIndicatorColumn>
                                            <ExpandCollapseColumn>
                                                <HeaderStyle Width="20px" />
                                            </ExpandCollapseColumn>
                                            <Columns>   
                                                <telerik:GridBoundColumn DataField="icm_cal_price_account_seq" 
                                                    UniqueName="icm_cal_price_account_seq"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="150px"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center" Visible = "false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn DataField="asset_name" HeaderText="รายการพัสดุ" ShowFilterIcon="false" HeaderStyle-Font-Bold="true"
                                                        HeaderStyle-HorizontalAlign="Center" FilterControlWidth="100%" UniqueName="asset_name" AutoPostBackOnFilter="true">
                                                        <ItemTemplate >                                                                                                                           
                                                                <asp:LinkButton ID="targetControl" runat="server" Text='<%# Eval("asset_name") %>' 
                                                                OnClientClick='<%# string.Format("return openStatusEdit(\"{0}\");", Eval("icm_cal_price_account_seq")) %>'  > 
                                                                </asp:LinkButton>
                                                        </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridBoundColumn DataField="fiscal_desc" 
                                                    HeaderText="งวดบัญชี" UniqueName="fiscal_desc"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="150px"
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="start_date_cal_depreciatiion" 
                                                    HeaderText="วันที่เริ่มคิดค่าเสื่อม" UniqueName="start_date_cal_depreciatiion"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" DataFormatString="{0:d}"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="150px" 
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="end_date_cal_depreciation" 
                                                    HeaderText="วันที่สุดท้ายที่คิดค่าเสื่อม" UniqueName="end_date_cal_depreciation"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" DataFormatString="{0:d}"
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="150px" 
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="remark" 
                                                    HeaderText="หมายเหตุเพิ่มเติม" UniqueName="remark"
                                                    FilterControlWidth="100%" AutoPostBackOnFilter="true" 
                                                    CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderStyle-Width="90px" 
                                                    HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="Delete" HeaderText="ลบ" HeaderStyle-Width="35px" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="Center"> 
                                                    <FilterTemplate></FilterTemplate>
                                                    <ItemTemplate>
                                                             &nbsp;&nbsp;&nbsp;
                                                             <asp:ImageButton ID="cmdDelete" runat="server" CommandName="DataDelete"
                                                                ImageUrl="~/App_UI/Image/Grid/Delete.gif" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')"
                                                                ToolTip="ลบรายการ" width="17" /> 
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                            <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                                                                            FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                                                                            NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                                                                            PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                                            </MasterTableView>
                                            <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                                                                GroupContinuedFormatString="" GroupContinuesFormatString="" 
                                                                GroupSplitFormat="" />
                                            <ClientSettings EnableRowHoverStyle="True">
                                                <Selecting AllowRowSelect="true" />
                                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                                            </ClientSettings>
                                      </telerik:RadGrid>
                                        </td>
                                  </tr>
                           </table>
                 </asp:Panel>
              </div>
</div>                           
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" >
    <Windows>
        <telerik:RadWindow ID="WindowDetail" runat="server" Width="1016px" Height="403px"
            showcontentduringload="false"  VisibleStatusbar="false"
            Modal="true" Skin = "Vista" behaviors="Close"
            title="ราคาทางบัญชี" 
            OnClientClose="closeRadWindow" >
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager> 

</asp:Content>